cmake_minimum_required(VERSION 3.10.2)

# 引入子目录的CmakeList.txt rmtp静态库
add_subdirectory(librtmp)

#导入头文件的路径 自动查看头文件 <> libx264 和 libfaac
include_directories(librtmp libx264/include libfaac/include)

# 设置x264库路径
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/libx264/libs/${CMAKE_ANDROID_ARCH_ABI}")

# 设置faac库路径
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/libfaac/libs/${CMAKE_ANDROID_ARCH_ABI}")

add_library(# 总库libnative-lib.so
        native-lib
        SHARED
        native-lib.cpp
        VideoChannel.cpp
        AudioChannel.cpp)

target_link_libraries(
        native-lib
        rtmp
        x264
        faac
        log)